//
//  DetailViewController.m
//  MaJangJi
//
//  Created by 嗯，大葱 on 16/9/10.
//  Copyright © 2016年 嗯，大葱. All rights reserved.
//

#import "DetailViewController.h"
#import "SDCycleScrollView.h"
#define k_Width      [UIScreen mainScreen].bounds.size.width

#define h_Height     [UIScreen mainScreen].bounds.size.height

@interface DetailViewController ()<SDCycleScrollViewDelegate>
{
     SDCycleScrollView *cycleScrollView;
}
@end

@implementation DetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configureViewController];
   
}
- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}
- (void)configureViewController {
//    self.view.backgroundColor = [UIColor whiteColor];
    UIView *statusBarView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, k_Width, 20)];
    statusBarView.backgroundColor=[UIColor colorWithRed:82/255.0 green:82/255.0 blue:82/255.0 alpha:1.0];
    [self.view addSubview:statusBarView];
    
    
    // 创建不带标题的图片轮播器
    cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0,k_Width,230) delegate:self placeholderImage:[UIImage imageNamed:@"111.png"]];//最后设置占位符
    cycleScrollView.localizationImageNamesGroup = @[@"111.png", @"111.png"]; //本地数组
    //网络数据
    //    cycleScrollView.imageURLStringsGroup = @[@"http://d.hiphotos.baidu.com/zhidao/pic/item/72f082025aafa40f507b2e99aa64034f78f01930.jpg", @"http://b.hiphotos.baidu.com/zhidao/pic/item/4b90f603738da9770889666fb151f8198718e3d4.jpg"];
    cycleScrollView.backgroundColor =[ UIColor clearColor];
    cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleToFill;
    cycleScrollView.showPageControl = YES;
    self.automaticallyAdjustsScrollViewInsets = NO;
    
    [self.view addSubview:cycleScrollView];
    // 轮播时间间隔，默认1.0秒，可自定义
    cycleScrollView.autoScrollTimeInterval = 4.0;
    
    
    
    
    
    
    
    
    
    //返回上一界面
    UIButton *backBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    backBtn.frame = CGRectMake(10, 30, 30, 30);
    [backBtn setImage:[UIImage imageNamed:@"返回"] forState:(UIControlStateNormal)];
    [backBtn addTarget:self action:@selector(handleBack) forControlEvents:(UIControlEventTouchUpInside)];
    //    backBtn.backgroundColor = [UIColor redColor];
    [self.view addSubview:backBtn];
    
    UIButton *wenBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    wenBtn.frame = CGRectMake(k_Width - 100, 30, 30, 30);
    [wenBtn setImage:[UIImage imageNamed:@"收藏"] forState:(UIControlStateNormal)];
    [wenBtn addTarget:self action:@selector(handleWen) forControlEvents:(UIControlEventTouchUpInside)];
    //    backBtn.backgroundColor = [UIColor redColor];
    [self.view addSubview:wenBtn];
    
    UIButton *wenBtn2 = [UIButton buttonWithType:(UIButtonTypeCustom)];
    wenBtn2.frame = CGRectMake(k_Width - 50, 30, 30, 30);
    [wenBtn2 setImage:[UIImage imageNamed:@"分享"] forState:(UIControlStateNormal)];
    [wenBtn2 addTarget:self action:@selector(handleWen) forControlEvents:(UIControlEventTouchUpInside)];
    //    backBtn.backgroundColor = [UIColor redColor];
    [self.view addSubview:wenBtn2];
}
//返回按钮点击事件
- (void)handleBack {
    [self dismissViewControllerAnimated:YES completion:nil];
}
//视图右侧按钮点击事件
- (void)handleWen {
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
- (IBAction)addWuLiaobtnAction:(UIButton *)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end
